class Sinhvien1sController < ApplicationController
  # GET /sinhvien1s
  # GET /sinhvien1s.json
  def index
    @sinhvien1s = Sinhvien1.all

    respond_to do |format|
      format.html # index.html.erb
      format.json { render json: @sinhvien1s }
    end
  end

  # GET /sinhvien1s/1
  # GET /sinhvien1s/1.json
  def show
    @sinhvien1 = Sinhvien1.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.json { render json: @sinhvien1 }
    end
  end

  # GET /sinhvien1s/new
  # GET /sinhvien1s/new.json
  def new
    @sinhvien1 = Sinhvien1.new

    respond_to do |format|
      format.html # new.html.erb
      format.json { render json: @sinhvien1 }
    end
  end

  # GET /sinhvien1s/1/edit
  def edit
    @sinhvien1 = Sinhvien1.find(params[:id])
  end

  # POST /sinhvien1s
  # POST /sinhvien1s.json
  def create
    @sinhvien1 = Sinhvien1.new(params[:sinhvien1])

    respond_to do |format|
      if @sinhvien1.save
        format.html { redirect_to @sinhvien1, notice: 'Sinhvien1 was successfully created.' }
        format.json { render json: @sinhvien1, status: :created, location: @sinhvien1 }
      else
        format.html { render action: "new" }
        format.json { render json: @sinhvien1.errors, status: :unprocessable_entity }
      end
    end
  end

  # PUT /sinhvien1s/1
  # PUT /sinhvien1s/1.json
  def update
    @sinhvien1 = Sinhvien1.find(params[:id])

    respond_to do |format|
      if @sinhvien1.update_attributes(params[:sinhvien1])
        format.html { redirect_to @sinhvien1, notice: 'Sinhvien1 was successfully updated.' }
        format.json { head :no_content }
      else
        format.html { render action: "edit" }
        format.json { render json: @sinhvien1.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /sinhvien1s/1
  # DELETE /sinhvien1s/1.json
  def destroy
    @sinhvien1 = Sinhvien1.find(params[:id])
    @sinhvien1.destroy

    respond_to do |format|
      format.html { redirect_to sinhvien1s_url }
      format.json { head :no_content }
    end
  end
end
